package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.LeaveInformationMapper;
import com.ruoyi.system.domain.LeaveInformation;
import com.ruoyi.system.service.ILeaveInformationService;

/**
 * 请假信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-23
 */
@Service
public class LeaveInformationServiceImpl implements ILeaveInformationService 
{
    @Autowired
    private LeaveInformationMapper leaveInformationMapper;

    /**
     * 查询请假信息
     * 
     * @param lineId 请假信息主键
     * @return 请假信息
     */
    @Override
    public LeaveInformation selectLeaveInformationByLineId(Long lineId)
    {
        return leaveInformationMapper.selectLeaveInformationByLineId(lineId);
    }

    /**
     * 查询请假信息列表
     * 
     * @param leaveInformation 请假信息
     * @return 请假信息
     */
    @Override
    public List<LeaveInformation> selectLeaveInformationList(LeaveInformation leaveInformation)
    {
        return leaveInformationMapper.selectLeaveInformationList(leaveInformation);
    }

    /**
     * 新增请假信息
     * 
     * @param leaveInformation 请假信息
     * @return 结果
     */
    @Override
    public int insertLeaveInformation(LeaveInformation leaveInformation)
    {
        leaveInformation.setCreateTime(DateUtils.getNowDate());
        return leaveInformationMapper.insertLeaveInformation(leaveInformation);
    }

    /**
     * 修改请假信息
     * 
     * @param leaveInformation 请假信息
     * @return 结果
     */
    @Override
    public int updateLeaveInformation(LeaveInformation leaveInformation)
    {
        return leaveInformationMapper.updateLeaveInformation(leaveInformation);
    }

    /**
     * 批量删除请假信息
     * 
     * @param lineIds 需要删除的请假信息主键
     * @return 结果
     */
    @Override
    public int deleteLeaveInformationByLineIds(Long[] lineIds)
    {
        return leaveInformationMapper.deleteLeaveInformationByLineIds(lineIds);
    }

    /**
     * 删除请假信息信息
     * 
     * @param lineId 请假信息主键
     * @return 结果
     */
    @Override
    public int deleteLeaveInformationByLineId(Long lineId)
    {
        return leaveInformationMapper.deleteLeaveInformationByLineId(lineId);
    }
}
